/**
* 
* ====================================================================
*
* @author apov <apov@ymail.com>
*/ 
#pragma once

#include <BaseDefine.h>

#ifndef DEF_VC6

#include <curl/curl.h>
//#include <curl/types.h>
#include <curl/easy.h>

/**
* @class HttpRequest
*  - 
*/
class HttpRequest{
	enum{
		DEF_HTTP_BUFF=		4096,
	};

public:
	char* request( char* url );
	long get_respond_code(){ return respond_code_; }

	HttpRequest();
	virtual ~HttpRequest();

protected:

private:
	static size_t callback_respond_from_request( void* ptr, size_t size, size_t nmemb, void* stream );

	long respond_code_;
	char* respond_content_type_;
	int respond_size_;
	double respond_speed_;
	
	char respond_[ DEF_HTTP_BUFF ];	

	CURL* handle_;
};

#endif
